package com.gongj.beanPostPorcessor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MeBeanPostPorcessor implements BeanPostProcessor {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
//		if("person".equals(beanName)){
//			System.out.println("初始化前====》" + "当前对象：" + bean + ",beanName = " + beanName);
//			return new User();
//		}
		return null;
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
//		if("person".equals(beanName)){
//			System.out.println("初始化后====》" + "当前对象：" + bean + ",beanName = " + beanName);
//			return new Person("gongjie");
//		}
		return null;
	}
}
